<?php
	$cs = Yii::app()->clientScript;
	$cs->registerCoreScript('jquery');
	$cs->registerScriptFile(BASE_URL . '/js/common.js', CClientScript::POS_END);
	$cs->registerScriptFile(BASE_URL . '/js/' . $this->module->id . '/' . MANGE_THEME . '/manage.js', CClientScript::POS_END);
	$cs->registerCssFile(BASE_URL . '/css/' . $this->module->id . '/' . MANGE_THEME . '/manage.css');
	
	//尝试包含当前页面样式及脚本
	$action_resource = $this->module->id . '/' . MANGE_THEME . '/' . $this->id . '_' . $this->action->id;
	if(file_exists(ROOT_PATH . '/js/' . $action_resource . '.js')){
		$cs->registerScriptFile(BASE_URL . '/js/' . $action_resource . '.js', CClientScript::POS_END);
	}
	if(file_exists(ROOT_PATH . '/css/' . $action_resource . '.css')){
		$cs->registerCssFile(BASE_URL . '/css/' . $action_resource . '.css');
	}
	$cs->registerScript('COMMON_JS', 
		'var DOMAIN = "' . SERVER_DOMAIN . '";',
	CClientScript::POS_BEGIN);
?>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="language" content="zh_cn" />
		<title><?php echo CHtml::encode($this->pageTitle); ?></title>
	</head>
	<body>
	<?php 
		if(isset($this->menu)){
			$this->widget('zii.widgets.CMenu', array(
				'items' 		=> $this->menu,
				'htmlOptions'	=> array('id'=>'right_nav'),
			));
		}
		echo $content;
		//分页
		if($this->pager != null){
			$this->widget('CLinkPager',array(
				'header' 			=> '',
				'firstPageLabel'	=> '首页',
				'lastPageLabel'		=> '末页',
				'prevPageLabel'		=> '上一页',
				'nextPageLabel'		=> '下一页',
				'pages' 			=> $this->pager,
				'maxButtonCount' 	=> 13,
			));
		}
	?>
	</body>
</html>
